Imports MIMS.WRS.Business
Public Class ConfirmToOverwriteOrAddToExistedList
    Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub
    Protected WithEvents lblConPointName As System.Web.UI.WebControls.Label
    Protected WithEvents btnReplace As System.Web.UI.WebControls.Button
    Protected WithEvents btnAdd As System.Web.UI.WebControls.Button

    'NOTE: The following placeholder declaration is required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
        Try
            lblConPointName.Text = ConPointService.GetConPoint(Convert.ToInt32(Request.Item("ConPointID"))).Description
        Catch ex As Exception
            lblConPointName.Text = ""
        End Try
    End Sub

    Private Sub btnReplace_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReplace.Click
        Try
            Dim userId As Int32 = Convert.ToInt32(Request.Item("userid"))
            Dim userEmail As String = Convert.ToString(Request.Item("useremail"))
            If (userId > 0) Then
                ShoppingConext.ShopingUserId = userId
                ShoppingConext.ShopingUserEmail = userEmail
            End If
        Catch ex As Exception
        End Try
        Page.RegisterStartupScript("windowClose", "<script language='javascript'>windowCloseAndRefresh1(3);</script>") ' replace
    End Sub

    Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
        Try
            Dim userId As Int32 = Convert.ToInt32(Request.Item("userid"))
            Dim userEmail As String = Convert.ToString(Request.Item("useremail"))
            If (userId > 0) Then
                ShoppingConext.ShopingUserId = userId
                ShoppingConext.ShopingUserEmail = userEmail
            End If
        Catch ex As Exception
        End Try
        Page.RegisterStartupScript("windowClose", "<script language='javascript'>windowCloseAndRefreshAddToList(2);</script>")
    End Sub
End Class
